#include "KmyVarString.h"
#include <cstring>

KmyVarString::KmyVarString(const string &str)
{
    length = str.size()+1;
    data = new u8[length];
    const char* c = str.c_str();
    memcpy((void*)data, (const void*)c, length-1);
    data[length-1] = 0;
}

KmyVarString::~KmyVarString(){
    delete[] data;
    data = NULL;
}

int KmyVarString::getVarType(){
    return KmyVar::VARIABLE_TYPE_STRING;
}
